var http = require('http')
var fs = require('fs')
var server = http.createServer()
server.on('request', function (request, response) {
    response.writeHead(200, {
        "Access-Control-Allow-Origin":"*",
        'Content-Type':'text/plain;charset=utf-8'
    });
    fs.readFile('./product.json', function(err, data) {
        if(err){
            console.log(err);
        }
        response.end(data);
    });
});
server.listen(3002, function(err){
    console.log('listening port 3002.')
})